<%@ Reference Control="~/Controls/GroupBlogTabs.ascx" %>
<%@ Reference Control="~/Controls/UserBlogTabs.ascx" %>
<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.post_blog_comment" ValidateRequest=false CodeFile="post_blog_comment.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<%@ Register tagprefix="UserBlogTabs" Tagname="UserBlogTabs" Src="Controls/UserBlogTabs.ascx" %>
<%@ Register tagprefix="GroupBlogTabs" Tagname="GroupBlogTabs" Src="Controls/GroupBlogTabs.ascx" %>
<FORM id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="100%">
		<tr>
			<td colspan="3">
				<table cellspacing="0" cellpadding="0" width="100%" border="0" class="page_title">
					<tr>
						<td><asp:literal id="litMainPageTitle" runat="server">Post New Blog Comment</asp:literal></td>
						<td align="right"><asp:hyperlink id="hlBackToGroup" cssclass="white_link" runat="server"></asp:hyperlink></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top" height="100%" class="main_table_border">
				<div class="content">
					<table cellspacing="0" cellpadding="0" width="100%" border="0" class="main_text">
						<userblogtabs:userblogtabs id="ucBlogTabs" runat="server"></userblogtabs:userblogtabs>
						<groupblogtabs:groupblogtabs id="grpBlogTabs" runat="server"></groupblogtabs:groupblogtabs>
						<tr>
							<td>
								<table cellspacing="0" cellpadding="0" border="0" class="main_text_err_form">
									<tr>
										<td class="small" height="15" colspan="2">&nbsp;</td>
									</tr>
									<tr>
										<td class="small" style="padding:0px">&nbsp;</td>
										<td align="left" id="error"><asp:validationsummary id="ValidationSummary1" runat="server" forecolor="#F04C03" height="32px" displaymode="List"
												cssclass="val_summary" width="440px"></asp:validationsummary></td>
									</tr>														
									<tr>
										<td width="60"><b><asp:literal id="litMessage" runat="server">Message</asp:literal>&nbsp;</b></td>
										<td valign="top">
											<asp:textbox id="txtMessage" runat="server" cssclass="scrollbar" width="500px" rows="8" textmode="MultiLine" maxlength="10000" height="200px"></asp:textbox>
											<asp:requiredfieldvalidator id="rvMessage" runat="server" display="None" controltovalidate="txtMessage" errormessage="Please fill in field Message"></asp:requiredfieldvalidator>
											<asp:customvalidator id="cvHtmlInBody" runat="server" controltovalidate="txtMessage" errormessage="HTML is not allowed in Message field"	display="None"></asp:customvalidator>
										</td>
									</tr>
									<tr>
										<td class="small" colspan="2" height="4">&nbsp;</td>
									</tr>
										<tr>
										<td class="small" colspan="2" height="10" align="right"><input type=button value="Add link" name=btnAddLink onclick="javascript: addLink('_ctl0:txtMessage')" class="btn" style="WIDTH:70px"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);">&nbsp; 
										&nbsp;<input type=button value="Add image" name=btnAddImage  onclick="javascript: addImage('_ctl0:txtMessage')" class="btn" style="WIDTH:80px"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);"></td>
									</tr>
									<tr>
										<td class="small" colspan="2" height="10">&nbsp;</td>
									</tr>
									<tr>
										<td class="small" align="right" colspan="2" height="21">
											<asp:button id="btnPostBlogComment" runat="server" cssclass="btn" text="Post" width="50px" onmouseover="ButtonMouseOver(this);"
												onmouseout="ButtonMouseOut(this);" onclick="btnPostBlogComment_Click"></asp:button></td>
									</tr>
								</table>							
							</td>
						</tr>
					</table>	
				</div>
			</td>
			<!-- BEGIN SKYSCRAPER ADVERTISEMENT -->	
			<!--
			<td class="small" width="10">&nbsp;</td>
			<td class="border_adv" vAlign="top" width="203" height="100%">
				<table cellSpacing="1" cellPadding="0" width="100%" border="0">
					<tr>
						<td class="small" width="10">&nbsp;</td>
						<td class="advertisement" width="193"><asp:Literal id="litSkyscraperAdvertisement" runat=server></asp:literal></td>
					</tr>
				</table>
			</td>-->
			<!-- END SKYSCRAPER ADVERTISEMENT -->
		</tr>
	</table>
</FORM>
<script>
	// Add blog link/image functionality

	//Function to add link
	var g_messageBox;
	
	function addLink(messageBox){
		var linkPath = new String();
		linkPath = popLinkWin("link", messageBox);
		
		addLinkNS (linkPath);
		//if (typeof(linkPath)!="undefined") {
		//	msgBox = eval("document.forms[0]['" + messageBox + "']")
		//	msgBox.value = msgBox.value + "<%=sLinkTag%>" + linkPath + " ";				
		//}
	}
	
	function addLinkNS(linkPath){		
		if (typeof(linkPath)!="undefined") {
			msgBox = eval("document.forms[0]['" + g_messageBox + "']");
			msgBox.value = msgBox.value + "<%=sLinkTag%>" + linkPath + " ";				
		}
	}

	//Function to add image
	function addImage(messageBox) {	
		var linkPath = new String();
		linkPath = popLinkWin("image", messageBox);
		
		addImageNS(linkPath);
		
		//if (typeof(linkPath)!="undefined") {
		//	msgBox = eval("document.forms[0]['" + messageBox + "']")
		//	msgBox.value = msgBox.value + "<%=sImageTag%>" + linkPath + " ";				
		//}
	}
	
	function addImageNS(linkPath) {	
		if (typeof(linkPath)!="undefined") {
			msgBox = eval("document.forms[0]['" + g_messageBox + "']")
			msgBox.value = msgBox.value + "<%=sImageTag%>" + linkPath + " ";				
		}
	}
		
	function showDialog(url, width, height, messageBox) {
		var sFeatures;
		sFeatures="dialogWidth: "+width+"px; ";
		sFeatures+="dialogHeight: "+height+"px; ";
		sFeatures+="help: no; ";
		sFeatures+="resizable: no; ";
		sFeatures+="scroll: no; ";
		sFeatures+="status: yes; ";
		sFeatures+="unadorned: no; ";

		var result, oWin;
		
		g_messageBox = messageBox;
		
		if (document.all) {
			result = window.showModalDialog(url,"", sFeatures);
		} else {
			oWin = window.open(url,"","width="+width+"px, height="+height+"px");
		}
			
		return result;
		
	}

	function popLinkWin(sType, messageBox) {
		return showDialog("add_link.aspx?type=" + sType, 400, 168, messageBox);
	}
</script>

